// router/index.js
import { createRouter, createWebHashHistory } from 'vue-router';
import Chat from '../views/ChatView.vue';
import MainView from '../views/MainView.vue';
import SettingsView from '../views/SettingsView.vue';
import LoginView from '../views/LoginView.vue'; // 引入LoginView

const routes = [
  { path: '/chat', component: Chat ,name: 'chat'},
  { path: '/main', component: MainView ,name: 'main'},
  { path: '/settings', component: SettingsView ,name: 'settings'},
  { path: '/login', component: LoginView ,name: 'login'}, // 添加登录页面的路由
  { path: '/', redirect: '/login' } // 默认重定向到登录页面
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
});

export default router;